home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Apple Remote Access API / ARA Security API 1.0 / SecurityInterfaces / SecurityPublic.h < prev    next >
Encoding:
Text File  |  1993-11-04  |  3.2 KB  |  115 lines  |  [TEXT/MPS ]

  1. //234567890123456789012345678901234567890123456789012345678901234567890123456789
  2. //===========================================================================
  3. //    File:    SecurityPublic.h
  4. //
  5. //    This file contains some public declarations for Apple Remote Access
  6. //    add-on security.  These are declarations that are accessed by modules
  7. //    outside of security modules.
  8. //
  9. //    Copyright © 1992, 1993 Apple Computer Inc.
  10. //    All rights reserved
  11. //
  12. //    Author:  Farzad Sarabi
  13. //
  14. //    Modification history:
  15. //
  16. //    5/14/1993        Farzad        Added ARADataLockFailed error code
  17. //    2/15/1993        Farzad        Added some new error codes
  18. //    11/11/1992        Farzad        Moved some of the declarations out of
  19. //                                SecurityInterface.h to here.
  20. //===========================================================================
  21.  
  22.  
  23. #ifndef SECURITY_PUBLIC
  24. #define SECURITY_PUBLIC 1
  25.  
  26.  
  27.  
  28. #define kSecurityMaxConfigData    150            // maximum number of bytes of
  29.                                             // security-sepcific configuration
  30.                                             // data
  31.  
  32. #define kSecurityUserInfoLength 32            // for GetUserInfo call, includes
  33.                                             // 1 byte for length field
  34.  
  35.  
  36. typedef long    SecurityReference;    // reference to a loaded code
  37.                                     // reference
  38.  
  39.  
  40.  
  41.  
  42. // the following are result codes returned by security code resources
  43. // as a response to various actions
  44.  
  45.  
  46. typedef enum    {
  47.         kSecurityNoErr,                // successful
  48.         kSecurityBadDataErr,        // passed in data is invalid
  49.         kSecurityGenericErr,        // for all errors not defined below
  50.         kSecurityMemErr,            // a memory manager problem
  51.         kSecurityUnsupportedAction    // an unknown action
  52.  
  53. } SecurityErrors;
  54.  
  55.  
  56.  
  57. typedef enum    {
  58.  
  59.         kSecurityStartup,        // first action you should setup everything
  60.         kSecurityShutdown,        // last action you should cleanup
  61.         kSecurityBegin,            // start of operation (e.g. authentication)
  62.         kSecurityEnd,            // end of operation (e.g. authentication)
  63.         kSecurityDataAvailable,    // you have data from other side
  64.         kSecurityAbort,            // ARA is requesting you to abort
  65.         kSecurityTickleAction    // sent to tickle you
  66.  
  67. } SecurityActions;                // you should support these actions
  68.  
  69.  
  70.  
  71.  
  72.  
  73. typedef enum    {
  74.  
  75.         ARANoErr,                // successful
  76.         ARAInternalError,        // ARA had an internal error
  77.         ARATimeout,                // operation timed out
  78.         ARAAbort,                // abort sent to completion routines
  79.         ARAGenericErr,            // used for abnormal conditions
  80.         ARABadReference,        // an invalid SecurityReference was passed to ARA
  81.         ARAServiceNotAvailable,    // this ARA service is not available to your
  82.                                 // type of code resource (e.g. a read is not
  83.                                 // provided for a configuration resource)
  84.         ARABufferFull,            // can't queue the requested operation
  85.         ARADataLockFailed        // the ReadLockSecurityData failed
  86.  
  87. } ARAErr;                        // result codes returned by ARA
  88.  
  89.  
  90.  
  91.  
  92. // the following is the type definition for an entry proc in a security
  93. // code resource
  94. typedef pascal long
  95.     ( * SecurityEntryProc )( SecurityActions        Action,
  96.                              SecurityReference        MyReference,
  97.                              long                    LongParam );
  98.  
  99.  
  100.  
  101.  
  102.  
  103. // the following is the type definition for completion procs provided to
  104. // the ARA services routines.
  105. typedef pascal void
  106.     ( * SecurityCompletionProc )( SecurityReference        MyReference,
  107.                                   int                    ResultCode,
  108.                                   void                    * DataPtr,
  109.                                   int                    DataSize,
  110.                                   long                    CompletionParam );
  111.  
  112.  
  113.  
  114. #endif
  115.